{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train = np.array([368,340,376,954,331,556])\n",
    "y_train = np.array([1.7,1.5,1.3,5,1.3,2.2])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7f2652eeb8d0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAASuklEQVR4nO3df5BdZX3H8ffXJOiKloWwpmQTDTMwsa0WiDtMHJWxpBpBh2SsZei0JTJp0x9M1TIThf7RTjudUSadorQdnAxpJ7SiUAyQMkhkANu/SLshlCAYWS1Ilh9ZKYlVthbit3/cZ2Gz7Obezd69d/fJ+zVz5z7nOc/Z+90D97PnPveck8hMJEl1eUO3C5AktZ/hLkkVMtwlqUKGuyRVyHCXpAot7HYBAKeffnquWLGi22VI0ryyZ8+eH2Zm32Tr5kS4r1ixgsHBwW6XIUnzSkQ8NdU6p2UkqUKGuyRVyHCXpAoZ7pJUIcNdkio0J86WkaQTyR17h9myaz/PHBplaW8Pm9euZP15/W19DcNdkjrojr3DXLNjH6MvHwFg+NAo1+zYB9DWgHdaRpI6aMuu/a8G+5jRl4+wZdf+tr6O4S5J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mNXZ9P2bmkcw8l8bV0+dHxLs6XUMzLdT4L8CKzPxl4F5eO0LuiIj4GHAwM/d08nVb1WJ9Xd2H47w/M1cBFwFXRsQFs/2Chvs4mfmjsY/KmXk3sCgiTu9kDRGxiEZofiUzd0wy5NXbOxTjb/3QEc1qnAv7cVwtY7fM+MiEVXPmNhlT1ZiZL2TmT8vijcB7Olza+4BLIuJJ4GvAhRHxTxPGdHM/Nq1vDuzDsTqGy/NBGvfnOn/CkLa/rw33cSLi58fmCyPifBr7p2Nv+PLa24DHM/Ovpxi2E7i8fLu+Gjicmc/OpRrnwH6c7JYZ35kwrKu3yWilxglzrpfQ+H6jYzLzmsxclpkraHxZen9m/taEYV3bj63U1+19WGo4OSLeOtYGPgxMPGOv7e/ref0PZE9XRHyVxpkcp0fEAeDPaHyRRWZ+mcb/nH8QEa8Ao8BlnXzD0zgS+W1gX5mLBfgT4O3jarybxjfrQ8BLwBUdrK/VGru9H6e6ZcZfAIOZuZPu3yajlRo/FRGXAK+UGj/Z4RonNcf24+vMwX24BLi9HO8sBG7OzHsi4vdh9t7X3n5AkirktIwkVchwl6QKGe6SVCHDXZIqZLhLUoUMd0mqkOEuSRX6fzX7EVqRfIgYAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(y_train,X_train,label = \"Train Samples\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=None, normalize=False)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train = X_train.reshape(-1,1)\n",
    "from sklearn.linear_model import LinearRegression\n",
    "lr = LinearRegression()\n",
    "lr.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=None, normalize=False)\n"
     ]
    }
   ],
   "source": [
    "print(lr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
